﻿Imports System.Data.OleDb
Public Class SiteFeedback
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    End Sub

    Protected Sub btn_feedback_Click(sender As Object, e As EventArgs) Handles btn_feedback.Click
        Dim oleDbConn As New OleDb.OleDbConnection(ConfigurationManager.ConnectionStrings("TwilightConn").ConnectionString)
        Dim SqlString As String = "INSERT INTO SiteFeedback(FeedbackName,FeedbackTwiWriter,FeedbackEmail,FeedbackComment) VALUES(@f1,@f2,@f3,@f4)"
        Dim cmd As OleDbCommand = New OleDbCommand(SqlString, oleDbConn)

        cmd.CommandType = CommandType.Text
        cmd.Parameters.AddWithValue("@f1", tb_feedbackName.Text)
        cmd.Parameters.AddWithValue("@f2", tb_feedbackTwiWriter.Text)
        cmd.Parameters.AddWithValue("@f3", tb_feedbackEmail.Text)
        cmd.Parameters.AddWithValue("@f4", tb_feedback.Text)
        oleDbConn.Open()
        cmd.ExecuteNonQuery()
        oleDbConn.Close()
        lbl_feedbackConfirmation.Text = "Thanks for submitting your comment. If you have requested contact, we aim to respond to messages within 3 working days."

    End Sub
End Class